<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <p>hello</p>

  <a href="#">ddddd</a>

  <div>dddsss</div>

  <ul>
    <li>asd</li>
    <li>asd</li>
  </ul>


  <script>

    HTMLElement.prototype.abcd = function () {
      // console.log(123);
      // this 表示调用该方法的DOM
      this.style.display = 'red';
    }

    // console.dir(document.querySelector('a'));

    document.querySelector('p').abcd();
    document.querySelector('a').abcd();
    document.querySelector('div').abcd();
    document.querySelector('ul').abcd();
  </script>

</body>

</html>